<aside class="main-sidebar sidebar-dark-primary elevation-4">
    <a href="{:U('Index/index')}" class="brand-link">
        <img src="wget/adminlte/AdminLTE-3.0.0-alpha/img/user3-128x128.jpg" class="brand-image img-circle elevation-3">
        <span class="brand-text font-weight-light">{:session('u_info.username')}</span>
    </a>
    <div class="sidebar">
        <nav class="mt-2">
            <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                <?php $menu = C('MENU_CONFIG.LEFT_MENU');
                if(is_array($menu)){
                    foreach($menu as $k1 => $v1){
                        if(is_numeric($k1)){
                ?>
                <li class="nav-header">{$v1}</li>
                <?php 
                        } else { 
                ?>
                <li class="nav-item has-treeview <?php if( CONTROLLER_NAME == $k1 ) { echo 'menu-open';} ?>">
                    <?php
                    $temp = false;
                    foreach($v1['content'] as $k2 => $v2){
                        if(!is_numeric($k2) && check_user_group_ext($k1 . '/' . $k2)){
                            $temp || $temp = TRUE;
                        }
                    }
                    if($temp){
                    ?>
                    <a href="javascript:void(0);" class="nav-link">
                        <i class="nav-icon fa {$v1.class}"></i>
                        <p>{$v1.name}<i class="right fa fa-angle-left"></i></p>
                    </a>
                    <ul class="nav nav-treeview" <?php if( CONTROLLER_NAME == $k1 ){ echo 'style="display:block"';} else { echo 'style="display:none"'; } ?>>
                        <?php
                            foreach($v1['content'] as $k2 => $v2){
                                if(is_numeric($k2)){
                                    echo '<li class="nav-header">'.$v2.'</li>';
                                } else {
                                    if(check_user_group_ext($k1 . '/' . $k2)){
                        ?>
                        <li class="nav-item">
                            <a href="{:U($k1.'/'.$k2)}" class="nav-link <?php if( in_array(CONTROLLER_NAME.'/'.ACTION_NAME,C('MENU_CONFIG.MENU_CONFIG_Jurisdiction.'.$k1.'/'.$k2)) ){ echo 'active';} ?>">
                                <i class="fa nav-icon"></i>
                                <p>{$v2}</p>
                            </a>
                        </li>
                        <?php }}} ?>
                    </ul>
                    <?php } ?>
                </li>
                <?php 
                        }
                    }
                } ?>
            </ul>
        </nav>
    </div>
</aside>